import About from '../pages/About/About';
import Home from '../pages/Home/Home';
import News from '../pages/News/News';
import Message from '../pages/Message/Message';
import NotFound from '../pages/NotFound/NotFound';
// import Welcome from '../pages/Welcome/Welcome';
import {Navigate} from 'react-router-dom';
import HeroList from '../pages/HeroList/HeroList';
import HeroDetail from '../pages/HeroDetail/HeroDetail';
import Hero from '../pages/Hero/Hero';

let routeArr = [
  {
    path: '/about',
    element: <About />
  },
  {
    path: '/home',
    element: <Home />,
    children: [  //children 
      {
        path: 'news',
        element: <News />
      },
      {
        path: 'message',
        element: <Message />
      },
      // {
      //   index: true,
      //   element: <Welcome />
      // }
      {
        index: true,
        element: <Navigate to="/home/news" />
      }
    ]
  },
  {
    path: '*',
    element: <NotFound />
  },
  {
    path: '/heros', //显示英雄列表
    element: <HeroList />
  },
  {
    path: '/hero',
    element: <HeroDetail />
  },
  {
    path: '/',
    element: <Hero />
  }
];

export default routeArr;
/**
 * app.get('/goods/:id', (req, res) => {}) 
 * 
 */

